local jueci = fk.CreateSkill {
  name = "lingling__jueci",
}

Fk:loadTranslationTable{
  ["lingling__jueci"] = "决辞",
  [":lingling__jueci"] = "出牌阶段限一次，你可以失去1点体力并令一名其他角色获得一张【杀】，然后其可以视为使用一张【杀】。",

  ["#lingling__jueci"] = "决辞：失去1点体力令一名角色获得一张【杀】，其可以视为使用一张【杀】",
  ["#lingling__jueci-slash"] = "决辞：你可以视为使用一张【杀】",
}

jueci:addEffect("active", {
  anim_type = "support",
  prompt = "#lingling__jueci",
  card_num = 0,
  target_num = 1,
  can_use = function (self, player)
    return player.hp > 0 and player:usedSkillTimes(jueci.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function (self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:loseHp(player, 1, jueci.name)
    if target.dead then return end
    local cards = room:getCardsFromPileByRule("slash", 1, "allPiles")
    if #cards > 0 then
      room:moveCardTo(cards, Card.PlayerHand, target, fk.ReasonJustMove, jueci.name)
      if target.dead then return end
    end
    room:askToUseVirtualCard(target, {
      name = "slash",
      skill_name = jueci.name,
      prompt = "#lingling__jueci-slash",
      cancelable = true,
      extra_data = {
        bypass_times = true,
        extraUse = true,
      },
    })
  end,
})

return jueci
